//
//  SYDWalletDetailCell.m
//  PinGJByOwnerSide
//
//  Created by lantaiyuan on 2017/8/8.
//  Copyright © 2017年 lantaiyuan. All rights reserved.
//

#import "SYDWalletDetailCell.h"
@interface SYDWalletDetailCell()
@property (weak, nonatomic) IBOutlet UILabel *walletMethodLbl;
@property (weak, nonatomic) IBOutlet UILabel *walletStatusLbl;
@property (weak, nonatomic) IBOutlet UILabel *detailTimeLbl;
@property (weak, nonatomic) IBOutlet UILabel *walletMoneyLbl;

@end
@implementation SYDWalletDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)walletDetailWithCashingGroupModel:(CashingGroupModel *)cashingGroupModel vehicleFeesModel:(VehicleFeesModel *)vehicleFeesModel status:(NSInteger)status{
    
    self.walletMoneyLbl.font = [UIFont systemFontOfSize:15.5];
    if (status == 1) {
        self.walletMethodLbl.text = @"提现";
        
        self.detailTimeLbl.text = [NSString timeWithTimeIntervalString:cashingGroupModel.cashingOrder.gmtCreate];
        
        NSInteger status = [cashingGroupModel.cashingOrder.status integerValue];
        /** 订单状态 1：发起申请 2：处理中 :3：提现成功 4：提现失败*/
        if (status == 1 || status == 2) {
            self.walletStatusLbl.text  = @"处理中";
            self.walletStatusLbl.textColor = RED_COLOR;
            [self.walletStatusLbl drawBorderWithColor:RED_COLOR radius:2];
            self.walletMoneyLbl.textColor = RED_COLOR;
            self.walletMoneyLbl.text = [NSString stringWithFormat:@"-%@",cashingGroupModel.inoutcomeDetail.amount];
        }else if (status == 3){
            self.walletStatusLbl.text  = @"提现成功";
            self.walletStatusLbl.textColor = GREEN_COLOR;
            [self.walletStatusLbl drawBorderWithColor:GREEN_COLOR radius:2];
            self.walletMoneyLbl.textColor = RED_COLOR;
            self.walletMoneyLbl.text = [NSString stringWithFormat:@"-%@",cashingGroupModel.inoutcomeDetail.amount];
        }else if (status == 4){
            self.walletStatusLbl.text  = @"提现失败";
            self.walletStatusLbl.textColor = GRAY_COLOR;
            [self.walletStatusLbl drawBorderWithColor:GRAY_COLOR radius:2];
            self.walletMoneyLbl.textColor = RED_COLOR;
            self.walletMoneyLbl.text = [NSString stringWithFormat:@"-%@",cashingGroupModel.inoutcomeDetail.amount];
        }else if (status == 5){
            
            self.walletStatusLbl.text  = @"退还";
            self.walletStatusLbl.textColor = GREEN_COLOR;
            [self.walletStatusLbl drawBorderWithColor:GREEN_COLOR radius:2];
            self.walletMoneyLbl.text = [NSString stringWithFormat:@"+%@",cashingGroupModel.inoutcomeDetail.amount];
        }
    }else if(status == 2){//提现退款
        self.walletMethodLbl.text = @"提现";
        self.walletStatusLbl.text  = @"退还";
        self.walletStatusLbl.textColor = GREEN_COLOR;
        [self.walletStatusLbl drawBorderWithColor:GREEN_COLOR radius:2];
        self.walletMoneyLbl.text = [NSString stringWithFormat:@"+%@",cashingGroupModel.inoutcomeDetail.amount];
        NSString *timeStr = cashingGroupModel.cashingOrder.gmtCreate;
        self.detailTimeLbl.text = [NSString timeWithTimeIntervalString:timeStr];
    }else if (status == 3){//收到车费
        self.walletMoneyLbl.font = [UIFont systemFontOfSize:15.5];
        self.walletMethodLbl.text = @"收到车费";
        self.walletMoneyLbl.text = [NSString stringWithFormat:@"+%@",vehicleFeesModel.amount];
        self.walletMoneyLbl.textColor = GREEN_COLOR;
        self.walletStatusLbl.hidden = YES;
        self.detailTimeLbl.text = [NSString timeWithTimeIntervalString:vehicleFeesModel.gmtCreate];
    }
}
-(void)walletDetailWithCashingGroupModel:(CashingGroupModel *)cashingGroupModel{
    
    
    
    
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
